3.2.24 \(\int \frac {\sec (c+d x) (A+C \sec ^2(c+d x))}{a+a \sec (c+d x)} \, dx\) [124]

Optimal. Leaf size=57 \[ -\frac {C \tanh ^{-1}(\sin (c+d x))}{a d}+\frac {C \tan (c+d x)}{a d}+\frac {(A+C) \tan (c+d x)}{a d (1+\sec (c+d x))} \]

[Out]

-C*arctanh(sin(d*x+c))/a/d+C*tan(d*x+c)/a/d+(A+C)*tan(d*x+c)/a/d/(1+sec(d*x+c))

________________________________________________________________________________________

Rubi [A]
time = 0.10, antiderivative size = 57, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.129, Rules used = {4168, 4083, 3855, 3879} \begin {gather*} \frac {(A+C) \tan (c+d x)}{a d (\sec (c+d x)+1)}+\frac {C \tan (c+d x)}{a d}-\frac {C \tanh ^{-1}(\sin (c+d x))}{a d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[(Sec[c + d*x]*(A + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

-((C*ArcTanh[Sin[c + d*x]])/(a*d)) + (C*Tan[c + d*x])/(a*d) + ((A + C)*Tan[c + d*x])/(a*d*(1 + Sec[c + d*x]))

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rule 3879

Int[csc[(e_.) + (f_.)*(x_)]/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x_Symbol] :> Simp[-Cot[e + f*x]/(f*(b + a*
Csc[e + f*x])), x] /; FreeQ[{a, b, e, f}, x] && EqQ[a^2 - b^2, 0]

Rule 4083

Int[(csc[(e_.) + (f_.)*(x_)]*(csc[(e_.) + (f_.)*(x_)]*(B_.) + (A_)))/(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_)), x
_Symbol] :> Dist[B/b, Int[Csc[e + f*x], x], x] + Dist[(A*b - a*B)/b, Int[Csc[e + f*x]/(a + b*Csc[e + f*x]), x]
, x] /; FreeQ[{a, b, e, f, A, B}, x] && NeQ[A*b - a*B, 0]

Rule 4168

Int[csc[(e_.) + (f_.)*(x_)]*((A_.) + csc[(e_.) + (f_.)*(x_)]^2*(C_.))*(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(
m_), x_Symbol] :> Simp[(-C)*Cot[e + f*x]*((a + b*Csc[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[1/(b*(m + 2))
, Int[Csc[e + f*x]*(a + b*Csc[e + f*x])^m*Simp[b*A*(m + 2) + b*C*(m + 1) - a*C*Csc[e + f*x], x], x], x] /; Fre
eQ[{a, b, e, f, A, C, m}, x] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {\sec (c+d x) \left (A+C \sec ^2(c+d x)\right )}{a+a \sec (c+d x)} \, dx &=\frac {C \tan (c+d x)}{a d}+\frac {\int \frac {\sec (c+d x) (a A-a C \sec (c+d x))}{a+a \sec (c+d x)} \, dx}{a}\\ &=\frac {C \tan (c+d x)}{a d}-\frac {C \int \sec (c+d x) \, dx}{a}+(A+C) \int \frac {\sec (c+d x)}{a+a \sec (c+d x)} \, dx\\ &=-\frac {C \tanh ^{-1}(\sin (c+d x))}{a d}+\frac {C \tan (c+d x)}{a d}+\frac {(A+C) \tan (c+d x)}{d (a+a \sec (c+d x))}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(227\) vs. \(2(57)=114\).
time = 2.05, size = 227, normalized size = 3.98 \begin {gather*} \frac {4 \cos \left (\frac {1}{2} (c+d x)\right ) \cos (c+d x) \left (A+C \sec ^2(c+d x)\right ) \left ((A+C) \sec \left (\frac {c}{2}\right ) \sin \left (\frac {d x}{2}\right )+C \cos \left (\frac {1}{2} (c+d x)\right ) \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )+\frac {\sin (d x)}{\left (\cos \left (\frac {c}{2}\right )-\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {c}{2}\right )+\sin \left (\frac {c}{2}\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right ) \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )}\right )\right )}{a d (A+2 C+A \cos (2 (c+d x))) (1+\sec (c+d x))} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[(Sec[c + d*x]*(A + C*Sec[c + d*x]^2))/(a + a*Sec[c + d*x]),x]

[Out]

(4*Cos[(c + d*x)/2]*Cos[c + d*x]*(A + C*Sec[c + d*x]^2)*((A + C)*Sec[c/2]*Sin[(d*x)/2] + C*Cos[(c + d*x)/2]*(L
og[Cos[(c + d*x)/2] - Sin[(c + d*x)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]] + Sin[d*x]/((Cos[c/2] - Sin
[c/2])*(Cos[c/2] + Sin[c/2])*(Cos[(c + d*x)/2] - Sin[(c + d*x)/2])*(Cos[(c + d*x)/2] + Sin[(c + d*x)/2])))))/(
a*d*(A + 2*C + A*Cos[2*(c + d*x)])*(1 + Sec[c + d*x]))

________________________________________________________________________________________

Maple [A]
time = 0.31, size = 92, normalized size = 1.61

method result size
derivativedivides \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) \(92\)
default \(\frac {A \tan \left (\frac {d x}{2}+\frac {c}{2}\right )+C \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-\frac {C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1}-C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )-\frac {C}{\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1}+C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d a}\) \(92\)
risch \(\frac {2 i \left (A \,{\mathrm e}^{2 i \left (d x +c \right )}+C \,{\mathrm e}^{2 i \left (d x +c \right )}+C \,{\mathrm e}^{i \left (d x +c \right )}+A +2 C \right )}{d a \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}+\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) C}{a d}-\frac {\ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) C}{a d}\) \(118\)
norman \(\frac {\frac {\left (A +C \right ) \left (\tan ^{5}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}+\frac {\left (A +3 C \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{a d}-\frac {2 \left (A +2 C \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{a d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}+\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{a d}-\frac {C \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{a d}\) \(126\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d/a*(A*tan(1/2*d*x+1/2*c)+C*tan(1/2*d*x+1/2*c)-C/(tan(1/2*d*x+1/2*c)+1)-C*ln(tan(1/2*d*x+1/2*c)+1)-C/(tan(1/
2*d*x+1/2*c)-1)+C*ln(tan(1/2*d*x+1/2*c)-1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 144 vs. \(2 (57) = 114\).
time = 0.29, size = 144, normalized size = 2.53 \begin {gather*} -\frac {C {\left (\frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{a} - \frac {\log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{a} - \frac {2 \, \sin \left (d x + c\right )}{{\left (a - \frac {a \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}\right )} {\left (\cos \left (d x + c\right ) + 1\right )}} - \frac {\sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}\right )} - \frac {A \sin \left (d x + c\right )}{a {\left (\cos \left (d x + c\right ) + 1\right )}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="maxima")

[Out]

-(C*(log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/a - log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/a - 2*sin(d*x + c)/
((a - a*sin(d*x + c)^2/(cos(d*x + c) + 1)^2)*(cos(d*x + c) + 1)) - sin(d*x + c)/(a*(cos(d*x + c) + 1))) - A*si
n(d*x + c)/(a*(cos(d*x + c) + 1)))/d

________________________________________________________________________________________

Fricas [A]
time = 3.41, size = 109, normalized size = 1.91 \begin {gather*} -\frac {{\left (C \cos \left (d x + c\right )^{2} + C \cos \left (d x + c\right )\right )} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (C \cos \left (d x + c\right )^{2} + C \cos \left (d x + c\right )\right )} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left ({\left (A + 2 \, C\right )} \cos \left (d x + c\right ) + C\right )} \sin \left (d x + c\right )}{2 \, {\left (a d \cos \left (d x + c\right )^{2} + a d \cos \left (d x + c\right )\right )}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*((C*cos(d*x + c)^2 + C*cos(d*x + c))*log(sin(d*x + c) + 1) - (C*cos(d*x + c)^2 + C*cos(d*x + c))*log(-sin
(d*x + c) + 1) - 2*((A + 2*C)*cos(d*x + c) + C)*sin(d*x + c))/(a*d*cos(d*x + c)^2 + a*d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {\int \frac {A \sec {\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx + \int \frac {C \sec ^{3}{\left (c + d x \right )}}{\sec {\left (c + d x \right )} + 1}\, dx}{a} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(A+C*sec(d*x+c)**2)/(a+a*sec(d*x+c)),x)

[Out]

(Integral(A*sec(c + d*x)/(sec(c + d*x) + 1), x) + Integral(C*sec(c + d*x)**3/(sec(c + d*x) + 1), x))/a

________________________________________________________________________________________

Giac [A]
time = 0.45, size = 101, normalized size = 1.77 \begin {gather*} -\frac {\frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{a} - \frac {C \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{a} - \frac {A \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{a} + \frac {2 \, C \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} a}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)*(A+C*sec(d*x+c)^2)/(a+a*sec(d*x+c)),x, algorithm="giac")

[Out]

-(C*log(abs(tan(1/2*d*x + 1/2*c) + 1))/a - C*log(abs(tan(1/2*d*x + 1/2*c) - 1))/a - (A*tan(1/2*d*x + 1/2*c) +
C*tan(1/2*d*x + 1/2*c))/a + 2*C*tan(1/2*d*x + 1/2*c)/((tan(1/2*d*x + 1/2*c)^2 - 1)*a))/d

________________________________________________________________________________________

Mupad [B]
time = 2.60, size = 72, normalized size = 1.26 \begin {gather*} \frac {2\,C\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{d\,\left (a-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )}-\frac {2\,C\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{a\,d}+\frac {\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\left (A+C\right )}{a\,d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((A + C/cos(c + d*x)^2)/(cos(c + d*x)*(a + a/cos(c + d*x))),x)

[Out]

(2*C*tan(c/2 + (d*x)/2))/(d*(a - a*tan(c/2 + (d*x)/2)^2)) - (2*C*atanh(tan(c/2 + (d*x)/2)))/(a*d) + (tan(c/2 +
 (d*x)/2)*(A + C))/(a*d)

________________________________________________________________________________________